{% extends 'pages/_base.html' %}
{% from 'tools/card.html' import nonModal %}
{% from 'tools/post.html' import post %}

{% block _base %}
    {% set categories = {'friend': '交友', 'help': '求助', 'consultation': '咨询', 'transaction': '交易', 'service': '服务'} %}

    {% for key, label in categories.items() %}
        {% set posts = data[key] if key in data and data[key] else [] %}

        {% set body %}
            {% for post_data in posts %}
                {{ post(post_data) }}
            {% endfor %}
        {% endset %}

        {{ nonModal(head=label, body=body) }}
    {% endfor %}
{% endblock %}
